home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Windows 95 with MFC
/
Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso
/
CODE
/
Chap06
/
Paint3
/
Paint3.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-05
|
2KB
|
75 lines
//***********************************************************************
//
// Paint3.h
//
//***********************************************************************
class CLine : public CObject
{
DECLARE_SERIAL (CLine)
private:
CPoint m_ptFrom;
CPoint m_ptTo;
UINT m_nWidth;
COLORREF m_crColor;
public:
CLine () {}
CLine (CPoint, CPoint, UINT, COLORREF);
virtual void Serialize (CArchive&);
virtual void Draw (CDC*);
};
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance ();
};
class CMainWindow : public CFrameWnd
{
private:
UINT m_nColor;
UINT m_nWidth;
CPoint m_ptFrom;
CPoint m_ptTo;
CObArray m_lineArray;
CString m_strFileName;
CString m_strPathName;
static const COLORREF crColors[8];
static const char szFilters[];
BOOL LoadFile (LPCSTR);
BOOL SaveFile (LPCSTR);
void UpdateWindowTitle ();
void InvertLine (CDC*, CPoint, CPoint);
void DeleteAllLines ();
public:
CMainWindow ();
~CMainWindow ();
protected:
afx_msg void OnPaint ();
afx_msg void OnFileNew ();
afx_msg void OnFileOpen ();
afx_msg void OnFileSave ();
afx_msg void OnFileSaveAs ();
afx_msg void OnFileExit ();
afx_msg void OnUpdateFileUI (CCmdUI*);
afx_msg void OnWidth (UINT);
afx_msg void OnUpdateWidthUI (CCmdUI*);
afx_msg void OnColor (UINT);
afx_msg void OnUpdateColorUI (CCmdUI*);
afx_msg void OnLButtonDown (UINT, CPoint);
afx_msg void OnMouseMove (UINT, CPoint);
afx_msg void OnLButtonUp (UINT, CPoint);
afx_msg void OnContextMenu (CWnd*, CPoint);
afx_msg void OnMeasureItem (int, LPMEASUREITEMSTRUCT);
afx_msg void OnDrawItem (int, LPDRAWITEMSTRUCT);
DECLARE_MESSAGE_MAP ()
};